<template>
  <div id="KnowledgeApprovalList">
    <div class="timelineBox">
      <el-timeline :reverse="true" style="margin-top: 10px">
        <el-timeline-item v-for="(activity, index) in approvalList" :key="index" type="primary" :timestamp="activity.timestamp" placement="top">
          {{activity.content}}
        </el-timeline-item>
      </el-timeline>
    </div>

  </div>
</template>
<script setup lang="ts">
// 引入组件区 ==========
import { reactive, getCurrentInstance } from 'vue';
let { proxy }: any = getCurrentInstance();
import {isEmpty} from "lodash"; //提示
defineExpose({ getApprovalList });
let approvalList: any = reactive([
  {
    content: '生产时间',
    timestamp: ''
  },{
    content: '出厂时间',
    timestamp: ''
  },{
    content: '建档时间',
    timestamp: ''
  },{
    content: '采购时间',
    timestamp: ''
  },{
    content: '启用时间',
    timestamp: ''
  }
]);

function getApprovalList(row: any) {
  approvalList[0].timestamp=row.produceDate;
  approvalList[1].timestamp=row.factoryDate;
  approvalList[2].timestamp=isEmpty(row.createTime)?'':row.createTime.substring(0,9);
  approvalList[3].timestamp=row.purchaseDate;
  approvalList[4].timestamp=row.activationDate;
}

</script>

<style lang="scss" scoped>
#KnowledgeApprovalList {
  height: 100%;
}
</style>